import React, { Component, Suspense } from 'react';
import { connect } from 'dva';
import { Layout, Menu, Breadcrumb, Carousel, Row, Col, Icon, Button, Divider, Tabs, List} from 'antd';
// import Ellipsis from '@/components/Ellipsis';
// import Slider from '@/components/Slider'
// import ActivitySlider from '@/components/ActivitySlider'
// import BigTitle from '@/components/BigTitle'
// import AboutUS from '@/components/AboutUS'
// import ContactUS from '@/components/ContactUS'
// import Question from '@/components/Question'
// import Information from '@/components/Information'
// import KnowMore from '@/components/KnowMore'
// import Links from '@/components/Links'
import FooterItem from '@/components/FooterItem'
// import {BIAOTI, GYWM, JIANTOU2, JIANTOU4, YUAN, LOGO, TITLE, DIBU} from '../../constants'
import styles from './index.less';
// import router from 'umi/router';
import {imgDomainName } from '@/constants/index'
import { FormattedMessage, formatMessage } from 'umi-plugin-react/locale';

@connect(({ home, loading }) => ({
  home,
  // loading: loading.effects['chart/fetch'],
}))
class Footer extends Component {
  state = {
  };

  componentDidMount() {
    const { dispatch }  = this.props;
    // dispatch({
    //   type: 'home/fetchCollege'
    // })

    // dispatch({
    //   type: 'home/fetchSetting',
    //   payload:{
    //     ids:'0'
    //   }
    // });
  }

  componentWillUnmount() {
  }

  getCollegeListWithPath = (collegeList) => {
    return collegeList.map(item => {
      let result = item;
      if (item.name === '法国里昂第三大学') {
        return { ...result, path: '/university/home?collegeId=4' }
      }
      else if (item.name === '法国保罗•瓦莱里大学') {
        return { ...result, path: '/university/home?collegeId=3' }
      }
      else if (item.name === '芬兰中央科技大学') {
        return { ...result, path: '/university/home?collegeId=2' }
      }
      else if (item.name === '法国IPAG高等商学院') {
        return { ...result, path: '/university/home?collegeId=1' }
      }

      return result;
    })
  }

  render() {
    // const {data, home: { collegeList, setting }} = this.props
    const { data, collegeData, setting } = this.props;
    const collegeListWithPath = this.getCollegeListWithPath(collegeData);
    // console.log("collegeListWithPath",collegeListWithPath);
    // const locale = localStorage.getItem('umi_locale');
    return (
      <div className={styles.footer}>
        <Row >
          <Col span={6}>
            <FooterItem
              title={'国际学校'}
              // title={<FormattedMessage id="company.home.international.universities" />}
              // list={[
              //     '法国保罗·瓦莱里大学',
              //     '法国里昂三大',
              //     '芬兰中央科技大学',
              //     '加拿大卡普顿大学',
              //     '乌克兰苏梅国立安格瑞大学',
              // ]}
              // list={collegeListWithPath.map(item => <span style={{cursor: 'pointer'}} onClick={() => window.open(item.path, '_blank')}>{locale === 'zh-CN' ? item.name : item.nameEN}</span>)}
              // list={collegeListWithPath.map(item => <span style={{cursor: 'pointer'}}>{locale === 'zh-CN' ? item.name : item.nameEN}</span>)}
              list={collegeListWithPath.map(item => <span style={{cursor: 'pointer'}}>{item.name}</span>)}
            />
          </Col>
          <Col span={3}>
            {/*<FooterItem*/}
            {/*title={'公司简介'}*/}
            {/*list={[*/}
            {/*<span style={{cursor: 'pointer'}} onClick={() => window.open('/company/introduction', '_blank')}>学院简介</span>,*/}
            {/*<span style={{cursor: 'pointer'}} onClick={() => window.open('/company/address', '_blank')}>校长致词</span>,*/}
            {/*<span style={{cursor: 'pointer'}} onClick={() => window.open('/company/teachList', '_blank')}>师资团队</span>,*/}
            {/*<span style={{cursor: 'pointer'}} onClick={() => window.open('/company/project', '_blank')}>项目介绍</span>,*/}
            {/*]}*/}
            {/*/>*/}
            <FooterItem
              title={'教学中心'}
              // title={<FormattedMessage id="company.home.teaching.center" />}
              list={[
                <span style={{cursor: 'pointer'}} onClick={() => window.open('http://home.himedu.cn/contact', '_blank')}>上海教学中心</span>,
                <span style={{cursor: 'pointer'}} onClick={() => window.open('http://home.himedu.cn/contact', '_blank')}>南京教学中心</span>,
                <span style={{cursor: 'pointer'}} onClick={() => window.open('http://home.himedu.cn/contact', '_blank')}>杭州教学中心</span>,
                <span style={{cursor: 'pointer'}} onClick={() => window.open('http://home.himedu.cn/contact', '_blank')}>北京教学中心</span>,
                <span style={{cursor: 'pointer'}} onClick={() => window.open('http://home.himedu.cn/contact', '_blank')}>济南教学中心</span>,
              ]}
              // list={[
              //   <span style={{cursor: 'pointer'}} onClick={() => window.open('/contact', '_blank')}><FormattedMessage id="company.home.shanghai.teaching.center" /></span>,
              //   <span style={{cursor: 'pointer'}} onClick={() => window.open('/contact', '_blank')}><FormattedMessage id="company.home.nanjing.teaching.center" /></span>,
              //   <span style={{cursor: 'pointer'}} onClick={() => window.open('/contact', '_blank')}><FormattedMessage id="company.home.hangzhou.teaching.center" /></span>,
              //   <span style={{cursor: 'pointer'}} onClick={() => window.open('/contact', '_blank')}><FormattedMessage id="company.home.beijing.teaching.center" /></span>,
              //   <span style={{cursor: 'pointer'}} onClick={() => window.open('/contact', '_blank')}><FormattedMessage id="company.home.jinan.teaching.center" /></span>,
              // ]}
            />
          </Col>
          <Col span={3}>
            <FooterItem
              title={'联系我们'}
              // title={<FormattedMessage id="company.home.footer.contact" />}
              list={[
                <span style={{cursor: 'pointer'}} onClick={() => window.open('http://home.himedu.cn/contact', '_blank')}>联系我们</span>,
                <span style={{cursor: 'pointer'}} onClick={() => window.open('http://home.himedu.cn/contact', '_blank')}>留言我们</span>,
              ]}
            />
          </Col>
          <Col span={6}>
            {/*<FooterItem*/}
            {/*title={'公司信息'}*/}
            {/*list={[*/}
            {/*`学院地址 : ${setting.address}`,*/}
            {/*`教务合作 : ${setting.phone}`,*/}
            {/*`${setting.pageNumber}`,*/}
            {/*]}*/}
            {/*/>*/}
            <FooterItem
              title={'商务合作'}
              // title={<FormattedMessage id="company.home.cooperation" />}
              list={[
                `联系电话 : 17717579514`,
                `联系地址 : 上海市徐汇区`,
              ]}
            />
          </Col>
          <Col span={6}>
            <Row style={{paddingTop: 3}}>
              <Col span={12} style={{textAlign: 'right'}}>
                <Row>
                  <Col span={24} >
                    <img style={{width: 86, height: 86}} src={setting.wechatPublicNumber && imgDomainName + setting.wechatPublicNumber} />
                  </Col>
                </Row>
                <Row style={{marginTop: 4}}>
                  <Col span={24}>
                    {/*<span style={{color: '#999999', fontSize: 11}}><FormattedMessage id="company.home.wechat" /></span>*/}
                    <span style={{color: '#999999', fontSize: 11}}>华隽官方公众号</span>
                  </Col>
                </Row>
              </Col>
              <Col span={12} style={{textAlign: 'center'}}>
                <Row>
                  <Col span={24} style={{marginTop: 5}}>
                    <img style={{width: 76, height: 76}} src={setting.wechatService && imgDomainName + setting.wechatService} />
                  </Col>
                </Row>
                <Row style={{marginTop: 8}}>
                  <Col span={24}>
                    {/*<span style={{color: '#999999', fontSize: 11}}><FormattedMessage id="company.home.registration.teaching" /></span>*/}
                    <span style={{color: '#999999', fontSize: 11}}>华隽报名教务微信</span>
                  </Col>
                </Row>
              </Col>
            </Row>
          </Col>



        </Row>
      </div>
    );
  }
}

export default Footer;
